'use strict';

/**
 * @ngdoc service
 * @name myAppApp.openApi
 * @description
 * # openApi
 * Service in the myAppApp.
 */
angular.module('jgappApp')
    .service('openApi', function () {
        var apiLocal = false;
        var ip;
        if (apiLocal) {
            ip = "json/"
        } else {
            // ip = "http://oa.jianguanoa.com/";
            // ip = "http://wangning1125.imwork.net/bm/";
            ip = "http://192.168.0.119/bm/";
            // ip = "http://192.168.0.112:8080/bm/";
        }
        var OpenApi = {
            ip: ip,
            start: ip + "my-process/start-process-and-save-form.do",
            getToken: ip + "rongyun/get-token.do",
            login: ip + "sys/app-login.do", //登录
            logout: ip + "sys/app-loginOut.do", //退出登录
            updateClientId: ip + "app-setting/update-client-id.do", //更新设备id
            feedback: ip + "app-setting/add-feedback.do", //意见反馈
            updatelog: ip + "app-setting/get-change-log.do", //更新日志
            addressbook: ip + "address-book/get-addresses-app.do", //通讯录
            addressbookTree: ip + "address-book/get-user-tree.do", //通讯录
            getAllDepartment: ip + "address-book/get-all-department.do", //获取部门列表
            getUserDetail: ip + "address-book/get-addresses-by-userId.do", //获取个人详情
            getAllprocess: ip + "/bpm-process-config/get-all-process-name.do", //获取所有流程类别列表
            userInfo: ip + "business-pub/get-app-user-info.do",
            getPageListByAccount: ip + "user/getPageListByAccount.do", //获取审批人员接口
            caduitObject: "/caduit-object/add-or-update.do", //获取审批人员接口
            category: ip + "my-process/list-as-category-app.do",
            borPerformance: ip + "/performance/find-page.do", //借业绩列表接口
            returnPerformance: ip + "/performance-return/get-can-return-pers.do", //还业绩列表接口
            getKeyType: ip + "public/get-key-and-value.do", //投标方式
            bidNotice: "/my-bid-notice/add-or-update.do", //投标公示栏
            bidCharge: "/bid-charge-single/add-or-update.do", //投标费用
            bidApply: "/bid-apply/add-or-update.do", //投标申请单
            payMoney: "/pay-money/add-or-update.do", //付款单
            borrowMoney: "/borrow-money/add-or-update.do", //借款单
            reimbursement: "/reimbursement/add-or-update.do", //报销单
            getRelModule_fk: ip + "pay-money/get-current-user-module-names.do", //付款关联模块
            getRelModule_jk: ip + "/borrow-money/get-current-user-module-names.do", //借款单关联模块
            getRelModule_oth: ip + "/other-money/get-current-user-module-names.do", //其他关联模块
            getRelModule_bx: ip + "/reimbursement/get-current-user-module-names.do", //报销关联模块
            getRelModule_caduit: ip + "/caduit-object/get-current-user-module-names.do", //自定义关联模块
            getRelpage: ip + "business-pub/get-related-pages-for-app.do", //模块内列表
            projectMoney: "/project-money/add-or-update.do", //工程款
            depositApply: "/deposit-apply-single/add-or-update.do", //保证金
            otherMoney: "/other-money/add-or-update.do", //收款
            performanceApply: "/performance-apply/add-or-update.do", //借业绩
            performanceApplySelectPer: "performanceApply_select_performance", //借业绩当中选择投标申请单
            performanceApplySelectProject: "performanceApply_select_project", //借业绩当中选择业绩列表
            performanceList: ip + "performance/get-detail-for-app.do", //借业绩证明材料列表
            performanceListA: ip + "performance-return/get-details.do", //还业绩证明材料列表
            performanceReturn: "/performance-return/add-or-update.do", //还业绩
            certificateApply: "/certificate-apply-new/add-or-update.do", //借证件
            certificateReturn: "/certificate-return/add-or-update.do", //还证件
            getAllCertificateA: ip + "/certificate-return/get-can-return-cers.do", //当前用户可以还的证件
            getAllCertificate: ip + "/certificate-apply-single/get-all-certificate-by-user.do", //当前用户可以借的证件
            getCerkey: ip + "public/get-key-and-value.do", //获取证件类别
            travelApply: "/travel-apply/add-or-update.do", //出差条申请
            bdApply: "/bd-apply/add-or-update.do", //出差条申请
            leaveApply: "/leave/add-or-update.do", //请假条申请
            overtimeApply: "/overtime-apply/add-or-update.do", //加班条申请
            daysoffApply: "/daysoff-apply/add-or-update.do", //补休条申请
            certificateCost: "/certificate-cost/add-or-update.do", //证件费用
            goOut: "/go-out/add-or-update.do", //外出办事
            useCar: "/use-car/add-or-update.do", //用车申请
            useSeal: "/use-seal/add-or-update.do", //用印登记
            certificateTransfer: "/certificate-transfer/add-or-update.do", //证件转出注销
            openAccount: "/open-account/add-or-update.do", //银行开户
            bankGuarantee: "/bank-guarantee/add-or-update.do", //银行保函
            taxReceipt: "/tax-receipt-register/add-or-update.do", //工程税票
            addedValueTax: "/added-value-tax/add-or-update.do", //增值税发票
            outRun: "/out-run/add-or-update.do", //外经证
            certificateDeal: "/certificate-deal/add-or-update.do", //办证件申请
            carveSeal: "/carve-seal/add-or-update.do", //刻印章申请
            borrowSeal: "/borrow-seal/add-or-update.do", //借印章申请
            returnSeal: "/return-seal/add-or-update.do", //还印章申请
            bcompanyContract: "/bcompany-contract/add-or-update.do", //分公司合同
            agreementApply: "/agreement-apply/add-or-update.do", //证件合同
            contractApply: "/contract-apply-single/add-or-update.do", //工程合同
            myTask: ip + "/my-task/get-untreated.do", //获取未处理任务
            myProcess: ip + "/my-process/get-wait-auditing.do", //获取待审批任务
            gettreated: ip + "/my-task/get-treated.do", //获取已处理任务
            getUntreated: ip + "my-task/get-untreated-and-unaudited-count.do", //获取未未读信息数目
            myProcessList: ip + "my-process/my-process-list-for-app.do", //"我的"模块接口
            allDetailApi: ip + "my-process/get-primary-object.do", //查看详情通用接口
            getTaskInfo: ip + "my-task/find-gtask-info.do", //查看详情通用接口(用于审批)
            myProcessLog: ip + "my-process/find-his.do", //查看审批日志
            myProcessLogA: ip + "my-task/find-his.do", //查看审批日志
            completeAudit: ip + "my-task/complete-aduit-task.do", //完成审批接口
            completeSyncAduit: ip + "/my-task/complete-sync-aduit-task.do", //并行完成审批接口
            completeCaduitObject: ip + "/caduit-object/caduit.do", //自定义审批接口
            getAppVersion: ip + "business-pub/get-app-version.do", //完成审批接口
            worktaskpublic: ip + "worktask-public/get-manager-level.do",
            getUsers: ip + "worktask-task/get-user-except-ids.do", //获取用户信息
            addTask: ip + "worktask-task/add.do", //新增任务
            updateTask: ip + "worktask-task/update.do", //新增任务
            getMyTask: ip + "worktask-task/get-my-task-list.do", //获取我的任务列表
            getMyTaskbypage: ip + "worktask-task/get-my-task-page.do", //我的任务分页
            setTaskStatus: ip + "worktask-task/set-task-status.do", //设置任务状态任务
            getTaskDetail: ip + "worktask-task/get-by-id.do", //获取任务详情
            addJoinPerson: ip + "worktask-task/add-join-person.do", //添加一个参与人
            delJoinPerson: ip + "worktask-task/delete-join-person.do", //删除一个参与人
            addSubTask: ip + "worktask-task/add-sub-task.do", //添加一个子任务
            updateSubTask: ip + "worktask-task/update-sub-task.do", //更新一个子任务
            delSubTask: ip + "worktask-task/delete-sub-task.do", //删除一个子任务
            finishSubTask: ip + "worktask-task/finish-sub-task.do", //完成一个子任务
            hasSeenByWorktask: ip + "worktask-hasseen/has-seen-by-worktask.do", //某个未查阅的任务添加一条查阅记录
            hasSeenByworkweekly: ip + "worktask-hasseen/has-seen-by-workweekly.do", //某个未查阅的周报添加一条查阅记录
            getLoglist: ip + "worktask-operationlog/list-for-worktask.do", //某个未查阅的任务添加一条查阅记录
            getworktaskHasseenList: ip + "worktask-hasseen/list-has-seen-by-worktask.do", //获取某个任务的查阅记录列表
            getworkweeklyHasseenList: ip + "worktask-hasseen/list-has-seen-by-workweekly.do", //获取某个周报的查阅记录列表
            addForWorktask: ip + "worktask-review/add-for-worktask.do", //为某个任务添加一个评论
            addForworklog: ip + "worktask-review/add-for-worklog.do", //为某个日报添加一个评论
            addForworkweekly: ip + "worktask-review/add-for-workweekly.do", //为某个周报添加一个评论
            getworktaskReviewlist: ip + "worktask-review/list-for-worktask.do", //获取某个任务的评论列表
            getworklogReviewlist: ip + "worktask-review/list-for-worklog.do", //获取某个日报的评论列表
            getworkweeklyReviewlist: ip + "worktask-review/list-for-workweekly.do", //获取某个周报的评论列表
            startSubTask: ip + "worktask-task/start-sub-task.do", //重新开始子任务
            getworklog: ip + "worktask-worklog/list-by-me-app.do", //查看日报
            getdailydetail: ip + "worktask-worklog/get-by-id-app.do", //获取工作日志中的全部明细app
            getworklogdetail: ip + "worktask-worklogdetail/list-for-all.do", //获取工作日志中的全部明细
            addDailylog: ip + "worktask-worklog/add-log.do", //新增日报
            getworklogBycondition: ip + "worktask-worklog/list-by-condition.do", //查阅日报
            getworklogByconditionApp: ip + "worktask-worklog/list-by-condition-app.do", //查阅日报
            getweeklyByconditionApp: ip + "worktask-weekly/list-by-condition-app.do", //查阅周报
            getdepts: ip + "worktask-public/get-depts.do", //获取用户所属下属部门
            getusersBydepId: ip + "worktask-public/get-users.do", //获取该部门下所有用户
            getWeeklyPage: ip + "worktask-weekly/get-weekly-page.do", //查阅周报
            getWeeklyApp: ip + "worktask-weekly/list-by-me-app.do", //查看当前用户自己的周报
            getWeeklyByStep: ip + "worktask-weekly/get-weekly-by-step.do", //获取我的周报
            addWeekly: ip + "worktask-weekly/add.do", //添加周报
            getweekDetail: ip + "worktask-weekly/get-by-id.do", //根据id查询周报内容
            getlogdatelist: ip + "worktask-worklog/get-log-date-list.do", //获取当前用户有查看权限的工作日志的日期列表
            getweeklydatelist: ip + "worktask-weekly/get-weekly-date-list.do", //获取当前用户有查看权限的周报的日期列表
            deleteprocess: ip + "my-process/delete-process-ins.do", //删除流程
            getRelatedModuleData: ip + "business-pub/get-related-module-data.do", //删除流程
            uploadFile: ip + "business-pub/uploadFile.do", //上传单个文件
            downLoadFile: ip + "business-pub/downLoadFile.do", //下载单个文件
            deleteFile: ip + "business-pub/deleteFile.do", //删除单个文件
            showimg: ip + "business-pub/show-img.do", //预览单个文件
            myBidNotice: ip + "my-bid-notice/find-page.do", //设置通知状态
            systemNotify: ip + "system-notify/get-system-notice-app.do", //设置通知状态
            settingportrait: ip + "app-setting/modify-portrait.do", //设置头像
            showportrait: ip + "app-setting/show-portrait.do", //显示头像
            previewfile: ip + "business-pub/preview/", //预览附件
            getPushStatus: ip + "app-setting/get-push-swtich-status.do", //获取通知状态
            setPushStatus: ip + "app-setting/swtich-push-status.do", //设置通知状态
            getuserinfo: ip + "rongyun/get-all-user-base-info.do", //获取用户信息数组
            getgrouplist: ip + "rongyun-group/get-grouplist.do", //获取群组列表
            creategroup: ip + "rongyun-group/create-group.do", //创建群组
            dismissgroup: ip + "rongyun-group/dismiss-group.do", //解散群组
            joingroup: ip + "rongyun-group/join-group-batch.do", //群组加人
            quitgroup: ip + "rongyun-group/quit-group.do", //退出群组
            refreshgroup: ip + "rongyun-group/refresh-group.do", //修改群组名称
            selectuser: ip + "rongyun/select-user-tree-by-flag.do", //发起聊天或者添加群组
            getGroup: ip + "rongyun-group/get-group.do", //获取群组详情
            getGroupUsers: ip + "rongyun/get-user-tree-by-flag.do", //获取群组成员列表
            customFields: ip + "my-task/get-custom-Fields-app.do", //获取自定义字段
            getPreviewUrl: ip + "business-pub/getPreviewUrl/", //获取文件外网路径
            attAdd: ip + "attendance-config/add-or-update.do", //新增考勤
            attList: ip + "attendance-config/find-list.do", //查看考勤列表
            attGet: ip + "attendance-config/get.do", //获取单个考勤详情
            attDel: ip + "attendance-config/del.do", //删除某个考勤
            attSelectdepartment: ip + "attendance-config/select-department.do", //选择考勤部门时的列表
            attGetExclusion: ip + "attendance-config/get-exclusion.do", //获取不需考勤人员的列表
            attSelectExclusionn: ip + "attendance-config/select-exclusion.do", //选择不需考勤人员的列表
            getAttendanceStatus: ip + "attendance-app/get-attendance-status.do", //获取考勤状态
            changeOvertime: ip + "attendance-app/change-to-overtime-status.do", //切换到加班
            punchClock: ip + "attendance-app/punch-clock.do",//打卡
            attendanceLoglist: ip + "attendance-month-log/get-month-list.do",//获取考勤年月统计列表
            attendanceLog: ip + "attendance-month-log/get-month-log-for-app.do",//获取某个考勤年月统计
            attLogDetail: ip + "attendance-month-log/get-month-log-total-detail-app.do",//获取考勤明细
            certificateShift: ip + "certificate-shift/get-shift-cers.do",//获件调配的证件
            addcertificateShift: "/certificate-shift/add-or-update.do",//获件调配的证件
            commisionApply: "/commision-apply/add-or-update.do",//提成申请流程
            commisionApplyrel: ip+"commision-apply/get-current-user-module-names.do"//获件调配的证件
        };
        var OpenApiLocal = {
            category: ip + "category.json", //发起新流程
            login: ip + "login.json"
        };
        if (apiLocal) {
            return OpenApiLocal
        } else {
            return OpenApi;
        }
    });
